package com.alameda.user.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Map;

/**
 * 用户操作日志实体类
 *
 * @author Lv
 * @date 2025/01/09
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName(value = "user_operate_log", autoResultMap = true)
@ApiModel(value = "UserOperateLogDO", description = "用户操作日志")
public class UserOperateLogDO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 用户操作记录id
     */
    @ApiModelProperty(value = "用户操作记录id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户名
     */
    @ApiModelProperty(value = "用户名")
    @TableField("user_name")
    private String userName;

    /**
     * 用户类型（0 app端  1 admin端 ）
     */
    @ApiModelProperty(value = "用户类型（0 app端  1 admin端 ）")
    @TableField("user_type")
    private Integer userType;

    /**
     * 操作api名称
     */
    @ApiModelProperty(value = "操作api名称")
    @TableField("operate_api_name")
    private String operateApiName;

    /**
     * 操作api时间
     */
    @ApiModelProperty(value = "操作api时间")
    @TableField("operate_api_time")
    private LocalDateTime operateApiTime;

    /**
     * 操作结果
     */
    @ApiModelProperty(value = "操作结果")
    @TableField("operate_api_result")
    private String operateApiResult;

    /**
     * 操作链路id
     */
    @ApiModelProperty(value = "操作链路id")
    @TableField("operate_api_trace_id")
    private String operateApiTraceId;

    /**
     * 创建人id
     */
    @ApiModelProperty(value = "创建人id")
    @TableField("create_id")
    private Long createId;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 修改人id
     */
    @ApiModelProperty(value = "修改人id")
    @TableField("update_id")
    private Long updateId;

    /**
     * 修改时间
     */
    @ApiModelProperty(value = "修改时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    /**
     * 逻辑删除标识符  0 未删除   1 已删除
     */
    @ApiModelProperty(value = "逻辑删除标识符  0 未删除   1 已删除")
    @TableField("delete_flag")
    @TableLogic
    private Integer deleteFlag;

    /**
     * 扩展属性
     */
    @ApiModelProperty(value = "扩展属性")
    @TableField(value = "ext_data", typeHandler = FastjsonTypeHandler.class)
    private Map<String, String> extData;

}
